package com.example.mychat.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.util.Date;

@Data
public class MessageWithThumb {
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private int receiverId; //接受消息的用户id，-1时表示公开消息，-2时表示写扩散的源消息

    @JsonSerialize(using = ToStringSerializer.class)
    private Long originId; //写扩散源消息的id

    private String username; //消息发布者

    private String text;    //消息内容

    private Date time;    //消息时间

    private Date expirationTime; //过期时间

    private int num;        //点赞数
}
